<include file="public@header"/>
</head>
<body>
<div class="layui-fluid js-check-wrap">
    <div class="layui-card">
        <div class="layui-card-header well">
            <div class="layui-col-xs6">
                <h3>{:lang('ADMIN_THEME_INDEX')}</h3>
            </div>
            <div class="layui-col-xs6 text-right">
                <!-- 添加分类 -->
                <a href="{:url('theme/install')}" class="layui-btn layui-btn-normal">{:lang('ADMIN_THEME_INSTALL')}</a>
            </div>
        </div>


        <form method="post" class="js-ajax-form margin-top-20">
            <php> $status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN'));</php>
            <div class="layui-card-body">    
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>模板</th>
                        <th>模板名称</th>
                        <th>版本号</th>
                        <th>语言</th>
                        <th>作者</th>
                        <th>模板描述</th>
                        <th width="200">{:lang('ACTIONS')}</th>
                    </tr>
                    </thead>
                    <tbody>
                        <foreach name="themes" item="vo">
                            <tr>
                                <td>
                                    {$vo.theme}
                                    <if condition="$vo.theme == $default_theme">
                                        <span class="layui-btn layui-btn-normal layui-btn-xs">当前启用</span>
                                    <elseif condition="in_array($vo['theme'], $enabled_themes)">
                                        <span class="layui-btn layui-btn-disabled layui-btn-xs">已被启用</span>
                                    </if>
                                </td>
                                <td>{$vo.name}</td>
                                <td>{$vo.version}</td>
                                <td>{$vo.lang}</td>
                                <td>{$vo.author}</td>
                                <td>{$vo.description}</td>
                                <td>
                                    <a class="layui-btn layui-btn-normal layui-btn-xs" href="javascript:parent.openIframeLayer('{:url('theme/files',array('theme'=>$vo['theme']))}','{$vo.name}文件列表',{});">设计</a>
                                    <a href="{:url('theme/update',array('theme'=>$vo['theme']))}" class="js-ajax-dialog-btn layui-btn layui-btn-xs"
                                       data-msg="确定更新此模板吗？">更新</a>

                                    <if condition="($vo.name == 'simpleboot3') OR in_array($vo['theme'], $enabled_themes)">
                                        <button class="layui-btn layui-btn-disabled layui-btn-xs">卸载</button>
                                        <else />
                                        <a href="{:url('theme/uninstall',array('theme'=>$vo['theme']))}" class="js-ajax-dialog-btn layui-btn layui-btn-danger layui-btn-xs"
                                           data-msg="您设置的模板数据将被删除，<br>确定卸载此模板吗？">卸载</a>
                                    </if>

                                    <if condition="in_array($vo['theme'], $enabled_themes)">
                                        <button class="layui-btn layui-btn-disabled layui-btn-xs">启用</button>
                                    <else />
                                        <a href="{:url('theme/active',array('theme'=>$vo['theme']))}" class="js-ajax-dialog-btn layui-btn layui-btn-warm layui-btn-xs"
                                           data-msg="确定使用此模板吗？">启用</a>
                                    </if>
                                </td>
                            </tr>
                        </foreach>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>
<include file="public@footer"/>
